﻿

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Data;

namespace .BizLogic
{
    using RDIFramework.BizLogic;
    using RDIFramework.Utilities;

    /// <summary>
    /// pmprojectsEntity
    /// pm_项目表
    /// 
    /// 修改纪录
    /// 
    /// 2025-01-18 版本：3.5  创建主键。
    /// 
    /// 版本：3.5
    /// 
    /// <author>
    /// <name></name>
    /// <date>2025-01-18</date>
    /// </author>
    /// </summary>
    [Serializable]
    public partial class pmprojectsEntity : BaseEntity
    {
        /// <summary>
        /// 项目id
        /// </summary>
        [Display(Name = "项目id")] 
        [Required(ErrorMessage = "需要输入项目id")]
        [DataMember] 
        public int? ProjectId { get; set; } 

        /// <summary>
        /// 项目组id
        /// </summary>
        [Display(Name = "项目组id")] 
        [Required(ErrorMessage = "需要输入项目组id")]
        [DataMember] 
        public int? GroupId { get; set; } 

        /// <summary>
        /// 项目名称
        /// </summary>
        [StringLength(255, ErrorMessage = "项目名称不能超过255个字符")] 
        [Display(Name = "项目名称")] 
        [Required(ErrorMessage = "需要输入项目名称")]
        [DataMember] 
        public string ProjectName { get; set; } 

        /// <summary>
        /// 项目简称
        /// </summary>
        [StringLength(255, ErrorMessage = "项目简称不能超过255个字符")] 
        [Display(Name = "项目简称")] 
        [Required(ErrorMessage = "需要输入项目简称")]
        [DataMember] 
        public string ProjectShortname { get; set; } 

        /// <summary>
        /// 网址
        /// </summary>
        [StringLength(255, ErrorMessage = "网址不能超过255个字符")] 
        [Display(Name = "网址")] 
        [Required(ErrorMessage = "需要输入网址")]
        [DataMember] 
        public string WebsitePc { get; set; } 

        /// <summary>
        /// 网址移动端
        /// </summary>
        [StringLength(255, ErrorMessage = "网址移动端不能超过255个字符")] 
        [Display(Name = "网址移动端")] 
        [Required(ErrorMessage = "需要输入网址移动端")]
        [DataMember] 
        public string WebsiteMobile { get; set; } 

        /// <summary>
        /// 项目开始日期
        /// </summary>
        [Display(Name = "项目开始日期")] 
        [Required(ErrorMessage = "需要输入项目开始日期")]
        [DataMember] 
        public DateTime? StartDate { get; set; } 

        /// <summary>
        /// 项目结束日期
        /// </summary>
        [Display(Name = "项目结束日期")] 
        [Required(ErrorMessage = "需要输入项目结束日期")]
        [DataMember] 
        public DateTime? EndDate { get; set; } 

        /// <summary>
        /// 项目描述
        /// </summary>
        [StringLength(, ErrorMessage = "项目描述不能超过个字符")] 
        [Display(Name = "项目描述")] 
        [Required(ErrorMessage = "需要输入项目描述")]
        [DataType(DataType.MultilineText)]
        [DataMember] 
        public String Description { get; set; } 

        /// <summary>
        /// 项目状态（1: 进行中, 0: 已完成）
        /// </summary>
        [Display(Name = "项目状态（1: 进行中, 0: 已完成）")] 
        [Required(ErrorMessage = "需要输入项目状态（1: 进行中, 0: 已完成）")]
        [DataMember] 
        public byte? Status { get; set; } 

        /// <summary>
        /// 创建时间
        /// </summary>
        [Display(Name = "创建时间")] 
        [Required(ErrorMessage = "需要输入创建时间")]
        [DataMember] 
        public DateTime? CreateTime { get; set; } 

        /// <summary>
        /// 更新时间
        /// </summary>
        [Display(Name = "更新时间")] 
        [Required(ErrorMessage = "需要输入更新时间")]
        [DataMember] 
        public DateTime? UpdateTime { get; set; } 

        /// <summary>
        /// 创建人
        /// </summary>
        [StringLength(100, ErrorMessage = "创建人不能超过100个字符")] 
        [Display(Name = "创建人")] 
        [Required(ErrorMessage = "需要输入创建人")]
        [DataMember] 
        public string CreatedBy { get; set; } 

        /// <summary>
        /// 最后修改人
        /// </summary>
        [StringLength(100, ErrorMessage = "最后修改人不能超过100个字符")] 
        [Display(Name = "最后修改人")] 
        [Required(ErrorMessage = "需要输入最后修改人")]
        [DataMember] 
        public string UpdatedBy { get; set; } 

        /// <summary>
        /// 构造函数
        /// </summary>
        public pmprojectsEntity()
        {
        }


        /// <summary>
        /// 从数据行读取
        /// </summary>
        /// <param name="dataRow">数据行</param>
        protected override BaseEntity GetFrom(IDataRow dataRow)
        {
            this.ProjectId = BusinessLogic.ConvertToNullableInt(dataRow[pmprojectsTable.FieldProjectId]);
            this.GroupId = BusinessLogic.ConvertToNullableInt(dataRow[pmprojectsTable.FieldGroupId]);
            this.ProjectName = BusinessLogic.ConvertToString(dataRow[pmprojectsTable.FieldProjectName]);
            this.ProjectShortname = BusinessLogic.ConvertToString(dataRow[pmprojectsTable.FieldProjectShortname]);
            this.WebsitePc = BusinessLogic.ConvertToString(dataRow[pmprojectsTable.FieldWebsitePc]);
            this.WebsiteMobile = BusinessLogic.ConvertToString(dataRow[pmprojectsTable.FieldWebsiteMobile]);
            this.StartDate = BusinessLogic.ConvertToNullableDateTime(dataRow[pmprojectsTable.FieldStartDate]);
            this.EndDate = BusinessLogic.ConvertToNullableDateTime(dataRow[pmprojectsTable.FieldEndDate]);
            this.Description = BusinessLogic.ConvertToString(dataRow[pmprojectsTable.FieldDescription]);
            this.Status = BusinessLogic.ConvertToString(dataRow[pmprojectsTable.FieldStatus]);
            this.CreateTime = BusinessLogic.ConvertToNullableDateTime(dataRow[pmprojectsTable.FieldCreateTime]);
            this.UpdateTime = BusinessLogic.ConvertToNullableDateTime(dataRow[pmprojectsTable.FieldUpdateTime]);
            this.CreatedBy = BusinessLogic.ConvertToString(dataRow[pmprojectsTable.FieldCreatedBy]);
            this.UpdatedBy = BusinessLogic.ConvertToString(dataRow[pmprojectsTable.FieldUpdatedBy]);
            return this;
        }
    }
}
